import { Component, OnInit } from '@angular/core';
import { NzMessageService, NzModalRef } from 'ng-zorro-antd';
import { SFSchema } from '@delon/form';
@Component({
  selector: 'app-online-edit',
  templateUrl: './edit.component.html',
})
export class CostOnlineEditComponent implements OnInit {
  i: any = {};
  accountInfo: string = '新增线上流水';
  schema: SFSchema = {
    properties: {
      title: {
        type: 'string',
        title: '标题'
      },
      money: {
        type: 'string',
        title: '金额'
      },
      status: {
        type: 'string',
        title: '状态',
        enum: [
          { value: '已完成', label: '已完成' },
          { value: '进行中', label: '进行中' },
          { value: '待开始', label: '待开始' }
        ]
      },
      opposite: {
        type: 'string',
        title: '去向'
      },
      remark: {
        type: 'string',
        title: '备注',
        ui: {
          widget: 'textarea',
          autosize: { minRows: 2, maxRows: 6 },
        },
      }
    },
    required: ['title', 'money', 'status'],
    ui: {
      spanLabelFixed: 100,
      grid: { span: 24 },
    }
  };
  constructor(private modal: NzModalRef, private msgSrv: NzMessageService) {}
  ngOnInit() {
  }
  save(value: any) {
    value.type = '线上'
    this.modal.close(value);
  }
  close() {
    this.modal.destroy();
  }
}
